﻿@{
    ViewBag.Title = "用户列表";
    Layout = null;
}
@using iCodeStudio.Entity;
@model IList<iCode_User>
<form id="pagerForm" method="post" action="#rel#">
    <input type="hidden" name="pageNum" value="@ViewBag.PageNum" />
    <input type="hidden" name="numPerPage" value="@ViewBag.NumPerPage" />
</form>

<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="@Url.Action("UserList", "UserManage")" method="post">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>用户姓名：</label>
                    <input type="text" name="userName" value="@ViewBag.UserName" />
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar" style="display:block">
        <ul class="toolBar">
            <li><a class="add" href="@Url.Action("AddUser", "UserManage")" title="新增用户" target="dialog"><span>添加</span></a></li>
            <li><a title="确实要删除这些记录吗?" callback="dialogAjaxDone" target="selectedTodo" rel="ids" posttype="string" href="@Url.Action("DeleteUser", "UserManage")" class="delete"><span>批量删除</span></a></li>
            <li><a class="edit" href="@Url.Action("EditUser", "UserManage")?id={sid_user}" target="dialog" warn="请选择一个用户"><span>修改</span></a></li>
            <li class="line">line</li>
        </ul>
    </div>
    <table class="table" width="1200" layouth="138">
        <thead>
            <tr>
                <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                <th width="120" orderfield="iCode_User_Account" class="asc">用户账号</th>
                <th orderfield="iCode_User_Pwd">用户密码</th>
                <th width="80" orderfield="iCode_User_Name">用户名称</th>
                <th width="70">操作</th>
            </tr>
        </thead>
        <tbody>
            @for (int i = 0; i < Model.Count; i++)
            {
                <tr target="sid_user" rel="@(i+1)">
                    <td><input name="ids" value="@Model[i].iCode_User_ID" type="checkbox"></td>
                    <td>@Model[i].iCode_User_Account</td>
                    <td>@Model[i].iCode_User_Pwd</td>
                    <td>@Model[i].iCode_User_Name</td>
                    <td>
                        <a title="确认删除？" target="ajaxTodo" callback="dialogAjaxDone" href="@Url.Action("DeleteUser", "UserManage")?id=@Model[i].iCode_User_ID" class="btnDel">删除</a>
                        <a title="编辑用户" target="dialog" href="@Url.Action("EditUser", "UserManage")?id=@Model[i].iCode_User_ID" class="btnEdit">编辑</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar" style="display:block">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <span>条，共 @ViewBag.TotalCount 条</span>
        </div>

        <div style="display:block" class="pagination" targettype="navTab" totalcount="@ViewBag.TotalCount" numperpage="@ViewBag.NumPerPage" pagenumshown="@ViewBag.PageNum" currentpage="1"></div>
    </div>
</div>
